﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Public.Ocean.Petrel.Extensions.Stream
{
    public abstract class Resolver
    {
        public string Identify<TContext, TReference>(TContext context, TReference reference)
        {
            return IdentifyCore(context, reference);
        }


        public TReference Resolve<TContext, TReference>(TContext context, string identity)
        {
            return ResolveCore<TContext, TReference>(context, identity);
        }

        protected abstract string IdentifyCore<TContext, TReference>(TContext context, TReference reference);
        protected abstract TReference ResolveCore<TContext, TReference>(TContext context, string identity);
    }
}